package juc.threadcore.uncaughtexception;

import java.util.concurrent.TimeUnit;

public class UserOwnUncaughtExeception implements Runnable {
    public static void main(String[] args) throws InterruptedException {
        Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtexceptionHanlder("MyExeceptionHanlder"));
        new Thread(new UserOwnUncaughtExeception()).start();
        TimeUnit.SECONDS.sleep(2);
        new Thread(new UserOwnUncaughtExeception()).start();
    }


    @Override
    public void run() {
        throw new RuntimeException();
    }
}
